From: kfraser@localhost.localdomain Date: Mon, 23 Oct 2006 12:10:24 +0000 (+0100) Subject: [XEN] Fill in runstate_info when virtual address is registered, X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15585^2~17 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=cbeadbce20d281be1b5037ab31b5d5832ea329cf;p=xen.git [XEN] Fill in runstate_info when virtual address is registered, even when it is registered from the 'wrong' VCPU. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 53d22417dc..3e0a2f82ae 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -378,6 +378,7 @@ arch_do_vcpu_op( case VCPUOP_register_runstate_memory_area: { struct vcpu_register_runstate_memory_area area; + struct vcpu_runstate_info runstate; rc = -EFAULT; if ( copy_from_guest(&area, arg, 1) ) @@ -390,8 +391,15 @@ arch_do_vcpu_op( v->runstate_guest = area.addr.v; if ( v == current ) + { __copy_to_user(v->runstate_guest, &v->runstate, sizeof(v->runstate)); + } + else + { + vcpu_runstate_get(v, &runstate); + __copy_to_user(v->runstate_guest, &runstate, sizeof(runstate)); + } break; }